$<-
operator. This method is never called explicitly, but through an indirect
usage of the $<-
operator, e.g. obj$name <- "foo"
.
"age"
, asetAge()
will
be looked for. If such a method exists it will be called with the Class
as the first argument andvalue
as the second, e.g.setAge(this, value)
.
Aget()
is only looked for if
is not a
private field. A private field is a namebeginningwith a.
(period). The rational for this naming convention is to be
consistent with howls()
works, which will not
list such members by default.value
to a
(existing or a non-existing) field namedname
.## S3 method for class 'Class':
$(this, name) <- value
## S3 method for class 'Class':
[[(this, name) <- value
this
, as all $<-
methods must do.Class
.For a complete example see help(Class).
Run the code above in your browser using DataLab